feat: add permissions boundary support to Lambda execution role - #10
Merged
Conversation
Introduces iam_permissions_boundary variable so the np-agent can attach a permissions boundary when creating the Lambda execution role, preventing privilege escalation at runtime. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…and remove dead scripts Read use_dedicated_role, role_name_template, role_policies, and dedicated role ARN/name from the scope-configurations provider instead of NRN. Remove rollback_iam_policies and delete_iam_role (both unused in workflows, lifecycle managed by Terraform). Simplify networking_healthy diagnose check to use Lambda resource-based policy instead of NRN-stored API Gateway ID. Drop stale NRN references from rollback_alias error messages and create_iam_role NRN write. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…build_context Source fetch_scope_configuration so scope-level workflows have access to provider data (AWS account, region, VPC, scope-configurations). Replace raw echo calls with log info/debug for consistency with the rest of the codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
IAM policy requires this tag on every Create* API call or the action is denied. Update all Terraform module locals and the create_iam_role CLI call to use ManagedBy=custom-scope-role instead of ManagedBy=terraform. Align test assertions accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
iam_permissions_boundaryvariable to the IAM modulepermissions_boundaryinaws_iam_role.lambdaat role creation timeWhy
The np-agent must set a permissions boundary on every execution role it creates to prevent privilege escalation. Without it, a role with
CreateRole+AttachRolePolicycould be used to self-escalate. The boundary is enforced at the IAM level, andiam:DeleteRolePermissionsBoundaryis denied by the boundary itself, so the role cannot remove its own protection.Test plan
IAM_PERMISSIONS_BOUNDARY_ARNset — verify the role is created with the boundary attachedIAM_PERMISSIONS_BOUNDARY_ARN— verify role creation is unaffected (boundary isnull)🤖 Generated with Claude Code